//...
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main(){
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	char s[500000], t[5002];
	int p=0, i, j, k, sum;
	vector<int > v;
	int vv[100000];
	while(gets(t)){
		sprintf(s+p, "%s", t);
		p+=strlen(t);
	}
	//printf("%s", s);
	p=strlen(s);
	memset(vv, 0, sizeof(vv));
	k=sum=0;
	for(i=2;i<p;++i){
		if(s[i]=='d'&&s[i-1]=='t'){
			if(s[i-2]=='/'){
				k--;
			}
			else{
				if(!vv[k])sum++;
				vv[k]++;
				k++;
			}
			if(!k&&sum){
				//v.push_back(sum);
				//sum=0;
			}
		}
	}
	sort(vv, vv+sum);
	for(i=0;i<sum;++i){
		printf("%d ", vv[i]);
	}
	
	
	
	return 0;
}
